package abel.wlmr.model;

import abel.wlmr.model.type.DataIdBody;
import io.netty.buffer.ByteBuf;

public class WlmrEmptyPart extends WlmrBasePart {

    /**
     * 
     */
    public WlmrEmptyPart() {
        super();
    }

    /**
     * @param guessedLen
     */
    public WlmrEmptyPart(short guessedLen) {
        super(guessedLen);
    }

    @Override
    public int parseBuf(ByteBuf buf) throws WlmrException {
        if (checkBuffer(buf) < 0) {
            return -1;
        }

        id = new DataIdBody();
        id.parseBuf(buf);
        int len = getGuessedLength() - DataIdBody.FIXED_LEN;

        buf.skipBytes(len);
        return getGuessedLength();
    }

    @Override
    public int getMinLength() {
        return DataIdBody.FIXED_LEN;
    }

}
